import sys
import glob

if __name__ == '__main__':
    file_dir = sys.argv[1]

    files = glob.glob(file_dir + '/*.csv')

    class2_dict = dict()
    class1_dict = dict()
    for f in files:
        for l in open(f):
            d = l.strip().split('\t')
            if len(d) < 2:
                continue

            if d[0] == '关键词':
                continue

            if len(d) == 2:
                class2_dict[d[1].strip()] = 1

            if len(d) > 2:
                class2_dict[d[2].strip()] = 1

            class1_dict[d[1].strip()] = 1

    for k in class1_dict.keys():
        print(k)
